<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Cheetah Software: utilities.h Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Cheetah Software
   &#160;<span id="projectnumber">1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>File&#160;List</span></a></li>
      <li><a href="../../globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('de/df0/utilities_8h_source.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">utilities.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="../../de/df0/utilities_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef PROJECT_UTILITIES_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define PROJECT_UTILITIES_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;algorithm&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;random&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;unordered_map&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="../../d9/d8e/cpp_types_8h.html">cppTypes.h</a>&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a16ea9aab4737c2622bc370d6a8613d63">   15</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="../../de/df0/utilities_8h.html#a16ea9aab4737c2622bc370d6a8613d63">fpEqual</a>(T a, T b, T tol) {</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;  <span class="keywordflow">return</span> std::abs(a - b) &lt;= tol;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;}</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a42a85233a23e8e7af211cb76f5fce9ee">   23</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="../../de/df0/utilities_8h.html#a42a85233a23e8e7af211cb76f5fce9ee">vectorEqual</a>(<span class="keyword">const</span> std::vector&lt;T&gt;&amp; a, <span class="keyword">const</span> std::vector&lt;T&gt;&amp; b) {</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;  <span class="keywordflow">if</span> (a.size() != b.size()) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; a.size(); i++) {</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="keywordflow">if</span> (a[i] != b[i]) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;  }</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;}</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a0aa540668aefb3f931f06b9af3b7098c">   35</a></span>&#160;T <a class="code" href="../../de/df0/utilities_8h.html#a0aa540668aefb3f931f06b9af3b7098c">coerce</a>(T in, T min, T max) {</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;  <span class="keywordflow">if</span> (in &lt; min) {</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    in = min;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;  }</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  <span class="keywordflow">if</span> (in &gt; max) {</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    in = max;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;  }</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;  <span class="keywordflow">return</span> in;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;}</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a2ecabd546948cea7bb3c432258a1b2ac">   46</a></span>&#160;T <a class="code" href="../../de/df0/utilities_8h.html#a2ecabd546948cea7bb3c432258a1b2ac">deadband</a>(T x, T range) {</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;  <span class="keywordflow">if</span> (x &lt; range &amp;&amp; x &gt; -range) x = T(0);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  <span class="keywordflow">return</span> x;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;}</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#ae3f93eed76d65a061a54d0b0b46db70a">   52</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../de/df0/utilities_8h.html#ae3f93eed76d65a061a54d0b0b46db70a">eigenDeadband</a>(Eigen::MatrixBase&lt;T&gt;&amp; v, <span class="keyword">typename</span> T::Scalar band) {</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; T::RowsAtCompileTime; i++) {</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0; j &lt; T::ColsAtCompileTime; j++) {</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;      v(i, j) = <a class="code" href="../../de/df0/utilities_8h.html#a2ecabd546948cea7bb3c432258a1b2ac">deadband</a>(v(i, j), band);</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    }</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;  }</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;}</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a1ab31b90bc584c635ec159468ceed9b2">   65</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../de/df0/utilities_8h.html#a1ab31b90bc584c635ec159468ceed9b2">sgn</a>(T val) {</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  <span class="keywordflow">return</span> (T(0) &lt; val) - (val &lt; T(0));</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;}</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#abbe68d910024077560aa4d2c88c9ca76">   75</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../de/df0/utilities_8h.html#abbe68d910024077560aa4d2c88c9ca76">fillEigenWithRandom</a>(</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    Eigen::MatrixBase&lt;T&gt;&amp; v, std::mt19937&amp; gen,</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    std::uniform_real_distribution&lt;typename T::Scalar&gt;&amp; dist) {</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; T::RowsAtCompileTime; i++) {</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0; j &lt; T::ColsAtCompileTime; j++) {</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;      v(i, j) = dist(gen);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    }</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;  }</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;}</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a4a58ce05a0a613ad84ef27f761d959f6">   89</a></span>&#160;T <a class="code" href="../../de/df0/utilities_8h.html#a4a58ce05a0a613ad84ef27f761d959f6">generator_gaussian_noise</a>(T mean, T var) {</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> hasSpare = <span class="keyword">false</span>;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;  <span class="keyword">static</span> T rand1, rand2;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  <span class="keywordflow">if</span> (hasSpare) {</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    hasSpare = <span class="keyword">false</span>;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="keywordflow">return</span> mean + sqrt(var * rand1) * sin(rand2);</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;  }</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  hasSpare = <span class="keyword">true</span>;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  rand1 = rand() / ((T)RAND_MAX);</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  <span class="keywordflow">if</span> (rand1 &lt; 1e-100) rand1 = 1e-100;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;  rand1 = -2 * log(rand1);</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;  rand2 = rand() / ((T)RAND_MAX) * M_PI * 2.;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;  <span class="comment">// printf(&quot;rand: %f, %f\n&quot;, rand1, rand2);</span></div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;  <span class="keywordflow">return</span> mean + sqrt(var * rand1) * cos(rand2);</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;}</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T1, <span class="keyword">typename</span> T2&gt;</div><div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a903d24212203968fe69a10dbcdb4a950">  112</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="../../de/df0/utilities_8h.html#a903d24212203968fe69a10dbcdb4a950">uMapContains</a>(<span class="keyword">const</span> std::unordered_map&lt;T1, T2&gt;&amp; <span class="keyword">set</span>, T1 key) {</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;  <span class="keywordflow">return</span> <span class="keyword">set</span>.find(key) != <span class="keyword">set</span>.end();</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;}</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T1, <span class="keyword">typename</span> T2&gt;</div><div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a8ee36d7e1f86b7307f0e0aef157237a7">  120</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="../../de/df0/utilities_8h.html#a8ee36d7e1f86b7307f0e0aef157237a7">mapContains</a>(<span class="keyword">const</span> std::map&lt;T1, T2&gt;&amp; <span class="keyword">set</span>, T1 key) {</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  <span class="keywordflow">return</span> <span class="keyword">set</span>.find(key) != <span class="keyword">set</span>.end();</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;}</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#acb4bfd4bd21d2af1b655d5039281ec3b">  130</a></span>&#160;std::string <a class="code" href="../../de/df0/utilities_8h.html#acb4bfd4bd21d2af1b655d5039281ec3b">numberToString</a>(T number) {</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  static_assert(std::is_floating_point&lt;T&gt;::value,</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;                <span class="stringliteral">&quot;numberToString must use a floating point type!&quot;</span>);</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;  <span class="keywordtype">char</span> buffer[100];</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;  sprintf(buffer, <span class="stringliteral">&quot;%g&quot;</span>, number);</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  <span class="keywordflow">return</span> std::string(buffer);</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;}</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a127a473fa496483dcfa8e843999d2741">  142</a></span>&#160;T <a class="code" href="../../de/df0/utilities_8h.html#a127a473fa496483dcfa8e843999d2741">mapToRange</a>(T x, T inputMin, T inputMax, T outputMin, T outputMax) {</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;  <span class="keywordflow">return</span> outputMin +</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;         (x - inputMin) * (outputMax - outputMin) / (inputMax - inputMin);</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;}</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a55ba169f0a864570abe97adfe4dbf540">  148</a></span>&#160;std::string <a class="code" href="../../de/df0/utilities_8h.html#a55ba169f0a864570abe97adfe4dbf540">eigenToString</a>(Eigen::MatrixBase&lt;T&gt;&amp; value) {</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;  std::stringstream ss;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;  ss &lt;&lt; value;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;  <span class="keywordflow">return</span> ss.str();</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;}</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#ae9a56a1d607c196f5e27de8125583c6a">  154</a></span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> std::string <a class="code" href="../../de/df0/utilities_8h.html#ae9a56a1d607c196f5e27de8125583c6a">boolToString</a>(<span class="keywordtype">bool</span> b) {</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;  <span class="keywordflow">return</span> std::string(b ? <span class="stringliteral">&quot;true&quot;</span> : <span class="stringliteral">&quot;false&quot;</span>);</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;}</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../de/df0/utilities_8h.html#a12c9857847f253886a46da7b5c32dbc6">writeStringToFile</a>(<span class="keyword">const</span> std::string&amp; fileName,</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;                       <span class="keyword">const</span> std::string&amp; fileData);</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;std::string <a class="code" href="../../de/df0/utilities_8h.html#a287878cb2b4807ea103f0bbea0b896bc">getCurrentTimeAndDate</a>();</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;std::string <a class="code" href="../../de/df0/utilities_8h.html#afe1bbec53e0ac370224c4aa5c3433b0e">getConfigDirectoryPath</a>();</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a5030ebabfff041e947bbf290ea294800">  168</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../de/df0/utilities_8h.html#a5030ebabfff041e947bbf290ea294800">EulerZYX_2_SO3</a>(<span class="keyword">const</span> <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;T&gt;</a>&amp; euler_zyx, <a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;T&gt;</a>&amp; SO3) {</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;T&gt;</a> Mat3_Z, Mat3_Y, Mat3_X;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;  Mat3_Z &lt;&lt; cos(euler_zyx[0]), -sin(euler_zyx[0]), 0, sin(euler_zyx[0]),</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;      cos(euler_zyx[0]), 0, 0, 0, 1;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;  Mat3_Y &lt;&lt; cos(euler_zyx[1]), 0, sin(euler_zyx[1]), 0, 1, 0,</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;      -sin(euler_zyx[1]), 0, cos(euler_zyx[1]);</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;  Mat3_X &lt;&lt; 1, 0, 0, 0, cos(euler_zyx[2]), -sin(euler_zyx[2]), 0,</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;      sin(euler_zyx[2]), cos(euler_zyx[2]);</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;  SO3 = Mat3_Z * Mat3_Y * Mat3_X;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;}</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;<span class="comment">// Smooth Changing</span></div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#ac7b8ad0e1d330d233fd5080d3846fdac">  182</a></span>&#160;T <a class="code" href="../../de/df0/utilities_8h.html#ac7b8ad0e1d330d233fd5080d3846fdac">smooth_change</a>(T ini, T end, T moving_duration, T curr_time) {</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;  <span class="keywordflow">if</span> (curr_time &gt; moving_duration) {</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordflow">return</span> end;</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;  }</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;  <span class="keywordflow">return</span> (ini +</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;          (end - ini) * 0.5 * (1 - cos(curr_time / moving_duration * M_PI)));</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;}</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00191"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#aaa4832258a624775b1780fc7e36fb574">  191</a></span>&#160;T <a class="code" href="../../de/df0/utilities_8h.html#aaa4832258a624775b1780fc7e36fb574">smooth_change_vel</a>(T ini, T end, T moving_duration, T curr_time) {</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;  <span class="keywordflow">if</span> (curr_time &gt; moving_duration) {</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="keywordflow">return</span> 0.0;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;  }</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;  <span class="keywordflow">return</span> ((end - ini) * 0.5 * (M_PI / moving_duration) *</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;          sin(curr_time / moving_duration * M_PI));</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;}</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00200"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a4f8f6b7789c59c9b0d0fc1eb25fb8758">  200</a></span>&#160;T <a class="code" href="../../de/df0/utilities_8h.html#a4f8f6b7789c59c9b0d0fc1eb25fb8758">smooth_change_acc</a>(T ini, T end, T moving_duration, T curr_time) {</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;  <span class="keywordflow">if</span> (curr_time &gt; moving_duration) {</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    <span class="keywordflow">return</span> 0.0;</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;  }</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;  <span class="keywordflow">return</span> ((end - ini) * 0.5 * (M_PI / moving_duration) *</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;          (M_PI / moving_duration) * cos(curr_time / moving_duration * M_PI));</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;}</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00209"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#ad97ad90ed11025262d42c71962a1da85">  209</a></span>&#160;T <a class="code" href="../../de/df0/utilities_8h.html#ad97ad90ed11025262d42c71962a1da85">stringToNumber</a>(<span class="keyword">const</span> std::string&amp; str) {</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;  static_assert(std::is_same&lt;T, double&gt;::value || std::is_same&lt;T, float&gt;::value,</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;                <span class="stringliteral">&quot;stringToNumber only works for double/float&quot;</span>);</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;  <span class="keywordflow">if</span> (std::is_same&lt;T, double&gt;::value) {</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    <span class="keywordflow">return</span> std::stod(str);</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (std::is_same&lt;T, float&gt;::value) {</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    <span class="keywordflow">return</span> std::stof(str);</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;  }</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;}</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00221"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a56c19e67ab316b5de1b2759866c3c9e6">  221</a></span>&#160;T <a class="code" href="../../de/df0/utilities_8h.html#ad97ad90ed11025262d42c71962a1da85">stringToNumber</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* str) {</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;  <span class="keywordflow">return</span> stringToNumber&lt;T&gt;(std::string(str));</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;}</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00226"></a><span class="lineno"><a class="line" href="../../de/df0/utilities_8h.html#a38a32f4265a57865e58d7e7bac196cc2">  226</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;T&gt;</a> <a class="code" href="../../de/df0/utilities_8h.html#a38a32f4265a57865e58d7e7bac196cc2">stringToVec3</a>(<span class="keyword">const</span> std::string&amp; str) {</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;T&gt;</a> v;</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;  <span class="keywordtype">size_t</span> i = 0;</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;  <span class="comment">// seek past whitespace</span></div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;  <span class="keywordflow">while</span> (str.at(i) == <span class="charliteral">&#39; &#39;</span>) i++;</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;  <span class="keywordflow">if</span> (str.at(i) == <span class="charliteral">&#39;[&#39;</span>) {</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    i++;</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;stringToVec3 didn&#39;t find open bracket&quot;</span>);</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;  }</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;  <span class="comment">// seek past whitespace</span></div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;  <span class="keywordflow">while</span> (str.at(i) == <span class="charliteral">&#39; &#39;</span>) i++;</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;  <span class="keywordtype">size_t</span> start = i;</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;  <span class="comment">// seek to end of first number</span></div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;  <span class="keywordflow">while</span> (str.at(i) != <span class="charliteral">&#39;,&#39;</span>) i++;</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;  v[0] = stringToNumber&lt;T&gt;(str.substr(start, i - start));</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;  i++;</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;  <span class="keywordflow">while</span> (str.at(i) == <span class="charliteral">&#39; &#39;</span>) i++;</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;  start = i;</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;  <span class="keywordflow">while</span> (str.at(i) != <span class="charliteral">&#39;,&#39;</span>) i++;</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;  v[1] = stringToNumber&lt;T&gt;(str.substr(start, i - start));</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;  i++;</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;  <span class="keywordflow">while</span> (str.at(i) == <span class="charliteral">&#39; &#39;</span>) i++;</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;  start = i;</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;  <span class="keywordflow">while</span> (str.at(i) != <span class="charliteral">&#39;]&#39;</span>) i++;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;  v[2] = stringToNumber&lt;T&gt;(str.substr(start, i - start));</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;  <span class="keywordflow">return</span> v;</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;}</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;std::string <a class="code" href="../../de/df0/utilities_8h.html#aa3945f023f4c554ec5670ac03ff82525">getLcmUrl</a>(<a class="code" href="../../d0/d99/c_types_8h.html#a350c6fc928e3bdc6c6486268ac8fb269">s64</a> ttl);</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;<span class="preprocessor">#endif  // PROJECT_UTILITIES_H</span></div><div class="ttc" id="utilities_8h_html_a4a58ce05a0a613ad84ef27f761d959f6"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a4a58ce05a0a613ad84ef27f761d959f6">generator_gaussian_noise</a></div><div class="ttdeci">T generator_gaussian_noise(T mean, T var)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00089">utilities.h:89</a></div></div>
<div class="ttc" id="utilities_8h_html_a16ea9aab4737c2622bc370d6a8613d63"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a16ea9aab4737c2622bc370d6a8613d63">fpEqual</a></div><div class="ttdeci">bool fpEqual(T a, T b, T tol)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00015">utilities.h:15</a></div></div>
<div class="ttc" id="utilities_8h_html_a287878cb2b4807ea103f0bbea0b896bc"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a287878cb2b4807ea103f0bbea0b896bc">getCurrentTimeAndDate</a></div><div class="ttdeci">std::string getCurrentTimeAndDate()</div><div class="ttdef"><b>Definition:</b> <a href="../../de/da5/utilities_8cpp_source.html#l00018">utilities.cpp:18</a></div></div>
<div class="ttc" id="utilities_8h_html_ac7b8ad0e1d330d233fd5080d3846fdac"><div class="ttname"><a href="../../de/df0/utilities_8h.html#ac7b8ad0e1d330d233fd5080d3846fdac">smooth_change</a></div><div class="ttdeci">T smooth_change(T ini, T end, T moving_duration, T curr_time)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00182">utilities.h:182</a></div></div>
<div class="ttc" id="cpp_types_8h_html_aa8cb424e643d476ea485238dad7c3e18"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, 3 &gt; Mat3</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00054">cppTypes.h:54</a></div></div>
<div class="ttc" id="utilities_8h_html_acb4bfd4bd21d2af1b655d5039281ec3b"><div class="ttname"><a href="../../de/df0/utilities_8h.html#acb4bfd4bd21d2af1b655d5039281ec3b">numberToString</a></div><div class="ttdeci">std::string numberToString(T number)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00130">utilities.h:130</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a6f07728c866b15ff0676a9b2ebfd2ba6"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, 1 &gt; Vec3</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00026">cppTypes.h:26</a></div></div>
<div class="ttc" id="cpp_types_8h_html"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html">cppTypes.h</a></div></div>
<div class="ttc" id="c_types_8h_html_a350c6fc928e3bdc6c6486268ac8fb269"><div class="ttname"><a href="../../d0/d99/c_types_8h.html#a350c6fc928e3bdc6c6486268ac8fb269">s64</a></div><div class="ttdeci">int64_t s64</div><div class="ttdef"><b>Definition:</b> <a href="../../d0/d99/c_types_8h_source.html#l00024">cTypes.h:24</a></div></div>
<div class="ttc" id="utilities_8h_html_a55ba169f0a864570abe97adfe4dbf540"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a55ba169f0a864570abe97adfe4dbf540">eigenToString</a></div><div class="ttdeci">std::string eigenToString(Eigen::MatrixBase&lt; T &gt; &amp;value)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00148">utilities.h:148</a></div></div>
<div class="ttc" id="utilities_8h_html_aa3945f023f4c554ec5670ac03ff82525"><div class="ttname"><a href="../../de/df0/utilities_8h.html#aa3945f023f4c554ec5670ac03ff82525">getLcmUrl</a></div><div class="ttdeci">std::string getLcmUrl(s64 ttl)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/da5/utilities_8cpp_source.html#l00032">utilities.cpp:32</a></div></div>
<div class="ttc" id="utilities_8h_html_a0aa540668aefb3f931f06b9af3b7098c"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a0aa540668aefb3f931f06b9af3b7098c">coerce</a></div><div class="ttdeci">T coerce(T in, T min, T max)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00035">utilities.h:35</a></div></div>
<div class="ttc" id="utilities_8h_html_a12c9857847f253886a46da7b5c32dbc6"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a12c9857847f253886a46da7b5c32dbc6">writeStringToFile</a></div><div class="ttdeci">void writeStringToFile(const std::string &amp;fileName, const std::string &amp;fileData)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/da5/utilities_8cpp_source.html#l00007">utilities.cpp:7</a></div></div>
<div class="ttc" id="utilities_8h_html_ad97ad90ed11025262d42c71962a1da85"><div class="ttname"><a href="../../de/df0/utilities_8h.html#ad97ad90ed11025262d42c71962a1da85">stringToNumber</a></div><div class="ttdeci">T stringToNumber(const std::string &amp;str)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00209">utilities.h:209</a></div></div>
<div class="ttc" id="utilities_8h_html_afe1bbec53e0ac370224c4aa5c3433b0e"><div class="ttname"><a href="../../de/df0/utilities_8h.html#afe1bbec53e0ac370224c4aa5c3433b0e">getConfigDirectoryPath</a></div><div class="ttdeci">std::string getConfigDirectoryPath()</div><div class="ttdef"><b>Definition:</b> <a href="../../de/da5/utilities_8cpp_source.html#l00030">utilities.cpp:30</a></div></div>
<div class="ttc" id="utilities_8h_html_a4f8f6b7789c59c9b0d0fc1eb25fb8758"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a4f8f6b7789c59c9b0d0fc1eb25fb8758">smooth_change_acc</a></div><div class="ttdeci">T smooth_change_acc(T ini, T end, T moving_duration, T curr_time)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00200">utilities.h:200</a></div></div>
<div class="ttc" id="utilities_8h_html_a2ecabd546948cea7bb3c432258a1b2ac"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a2ecabd546948cea7bb3c432258a1b2ac">deadband</a></div><div class="ttdeci">T deadband(T x, T range)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00046">utilities.h:46</a></div></div>
<div class="ttc" id="utilities_8h_html_a38a32f4265a57865e58d7e7bac196cc2"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a38a32f4265a57865e58d7e7bac196cc2">stringToVec3</a></div><div class="ttdeci">Vec3&lt; T &gt; stringToVec3(const std::string &amp;str)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00226">utilities.h:226</a></div></div>
<div class="ttc" id="utilities_8h_html_a5030ebabfff041e947bbf290ea294800"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a5030ebabfff041e947bbf290ea294800">EulerZYX_2_SO3</a></div><div class="ttdeci">void EulerZYX_2_SO3(const Vec3&lt; T &gt; &amp;euler_zyx, Mat3&lt; T &gt; &amp;SO3)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00168">utilities.h:168</a></div></div>
<div class="ttc" id="utilities_8h_html_a1ab31b90bc584c635ec159468ceed9b2"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a1ab31b90bc584c635ec159468ceed9b2">sgn</a></div><div class="ttdeci">int sgn(T val)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00065">utilities.h:65</a></div></div>
<div class="ttc" id="utilities_8h_html_a42a85233a23e8e7af211cb76f5fce9ee"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a42a85233a23e8e7af211cb76f5fce9ee">vectorEqual</a></div><div class="ttdeci">bool vectorEqual(const std::vector&lt; T &gt; &amp;a, const std::vector&lt; T &gt; &amp;b)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00023">utilities.h:23</a></div></div>
<div class="ttc" id="utilities_8h_html_ae3f93eed76d65a061a54d0b0b46db70a"><div class="ttname"><a href="../../de/df0/utilities_8h.html#ae3f93eed76d65a061a54d0b0b46db70a">eigenDeadband</a></div><div class="ttdeci">void eigenDeadband(Eigen::MatrixBase&lt; T &gt; &amp;v, typename T::Scalar band)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00052">utilities.h:52</a></div></div>
<div class="ttc" id="utilities_8h_html_a903d24212203968fe69a10dbcdb4a950"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a903d24212203968fe69a10dbcdb4a950">uMapContains</a></div><div class="ttdeci">bool uMapContains(const std::unordered_map&lt; T1, T2 &gt; &amp;set, T1 key)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00112">utilities.h:112</a></div></div>
<div class="ttc" id="utilities_8h_html_a8ee36d7e1f86b7307f0e0aef157237a7"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a8ee36d7e1f86b7307f0e0aef157237a7">mapContains</a></div><div class="ttdeci">bool mapContains(const std::map&lt; T1, T2 &gt; &amp;set, T1 key)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00120">utilities.h:120</a></div></div>
<div class="ttc" id="utilities_8h_html_abbe68d910024077560aa4d2c88c9ca76"><div class="ttname"><a href="../../de/df0/utilities_8h.html#abbe68d910024077560aa4d2c88c9ca76">fillEigenWithRandom</a></div><div class="ttdeci">void fillEigenWithRandom(Eigen::MatrixBase&lt; T &gt; &amp;v, std::mt19937 &amp;gen, std::uniform_real_distribution&lt; typename T::Scalar &gt; &amp;dist)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00075">utilities.h:75</a></div></div>
<div class="ttc" id="utilities_8h_html_aaa4832258a624775b1780fc7e36fb574"><div class="ttname"><a href="../../de/df0/utilities_8h.html#aaa4832258a624775b1780fc7e36fb574">smooth_change_vel</a></div><div class="ttdeci">T smooth_change_vel(T ini, T end, T moving_duration, T curr_time)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00191">utilities.h:191</a></div></div>
<div class="ttc" id="utilities_8h_html_ae9a56a1d607c196f5e27de8125583c6a"><div class="ttname"><a href="../../de/df0/utilities_8h.html#ae9a56a1d607c196f5e27de8125583c6a">boolToString</a></div><div class="ttdeci">static std::string boolToString(bool b)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00154">utilities.h:154</a></div></div>
<div class="ttc" id="utilities_8h_html_a127a473fa496483dcfa8e843999d2741"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a127a473fa496483dcfa8e843999d2741">mapToRange</a></div><div class="ttdeci">T mapToRange(T x, T inputMin, T inputMax, T outputMin, T outputMax)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00142">utilities.h:142</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_43e0a1f539e00dcfa1a6bc4d4fee4fc2.html">home</a></li><li class="navelem"><a class="el" href="../../dir_61bfb0b3cdda81b1b0355ba34eb3b1eb.html">dhkim</a></li><li class="navelem"><a class="el" href="../../dir_adee5b101e079090017bb4e91c628ead.html">Public_Repository</a></li><li class="navelem"><a class="el" href="../../dir_7fc07a7b97001e7b1d18e11da761e2de.html">Cheetah-Software</a></li><li class="navelem"><a class="el" href="../../dir_860379c26524a894b3cf97b5b1ba5bdb.html">common</a></li><li class="navelem"><a class="el" href="../../dir_275ce76ae8a9e2090fbb7142d3994a0e.html">include</a></li><li class="navelem"><a class="el" href="../../dir_d631aa3083290dc23dd8bdcd7ad213ec.html">Utilities</a></li><li class="navelem"><a class="el" href="../../de/df0/utilities_8h.html">utilities.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
